<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>销售报价</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript" src="${ctx}/js/jsp/yd/logic/soquote.js"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/yd/logic/soquote";
		var basic_WUrl="yd/logic/soquote";
		var basic_Title="添加";
		var show_Width=880;
		var show_Hight=500;
		function createSearch(){
			init(2,8,'100,100,100,100,100,100,100,100','10%');
			//第一行的数据
			addCommon(0,0,"lable","报价单编号：");
			addCommon(0,1,"txtlike","no");
			addCommon(0,2,"lable","客户名称：");
			addCommon(0,3,"txtlike","cli_name");
			addCommon(0,4,"lable","制单人：");
			addCommon(0,5,"txtlike","lister");
			addCommon(0,6,"lable","状态");
			addCommon(0,7,"selectEnum","billstatus","<option></option><option value='0'>草稿</option>"+
						"<option value='2'>待二级审批</option><option value='3'>待三级审批</option><option value='4'>二审完结</option><option value='5'>三审完结</option>"+
						"<option value='6'>二级已驳回</option><option value='7'>三级已驳回</option>");
		}
		
		function searchAP(){
			multipleSearch("#table1",true,"",basic_Url+"/list.do?cli_no="+actionNodeID);
		}
		
		

		//删除报价单
		function delitem(){
			var manager = $("#table1").ligerGetGridManager(); 
			var rows = manager.getSelectedRows();
			if (rows==null || 0== rows.length){
				$.dialog.alert('请选择需要操作删除的行！');
				return;
			}
			var canDel = true;
			$(rows).each(function() {
				if (!(this.billstatus==0 || this.billstatus==6 || this.billstatus==7)){
					canDel = false;
					$.dialog.alert('待删除的单据中,存在不能删除操作的单据状态！');
				}
				
				if(this.dcruser !='${user.name}'){
					canDel = false;
					$.dialog.alert('待删除的单据中,存在非本人的单据，不能删除操作!');
				}
			});
			if(canDel){
				del();//ajax 删除
			}
		}
	</script>
	
  </head>
 <body style="padding:10px" onload="createSearch()">  
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
          
          <!-- <div class="panelBar">
	            <ul class="toolBar">
		           <li><a class="add" onclick="basic_Title='添加';add()"><span>新增</span></a></li>
				   <li><a class="delete" onclick="checkdel()"><span>删除</span></a></li>
               </ul>
          </div> -->
      <div id="layout1">
          <div position="left" title="客户列表">
          		<div style="width:200px; height:450px; float:left;overflow:auto;  ">
   				 <ul id="tree1"></ul>
    			</div> 
          </div>
          <div position="center" title="报价单列表" id="table1"></div>
      </div>
      
<!--       <div class="clear"></div> -->
    </body>
</html>